from train.trainer import Train
import time
from configs.config import global_var
import os
from configs.train_conf import load_train_config
from utils.base_util import new_fold
import sys

# print(sys.path)

# global_var.address = 'C:/Users/adminTKJ/Desktop/RLIR_sumup/'


if __name__ == "__main__":
    # 训练deepBasic
    new_fold('train_history', ['eval/log_info', 'eval/checkpoint', 'model', 'vis_final'], "Basic")
    train_conf = load_train_config(global_var.loading_address)
    trainer = Train(**train_conf)
    trainer.run()
    trainer.logger.visualization()
    # 这段程序只是为了测试不同结构下的UBasic的表现
    # mlp_num = [1024, 512, 256, 128, 64]
    # conv_scale = [0.5, 1, 2, 4, 8]
    # for i in range(2, 6):
    #     temp_saving_path = global_var.saving_address
    #     new_fold('train_history', ['eval/log_info', 'eval/checkpoint', 'model', 'vis_final'],
    #              "UBasicConvDepth{0}".format(i))
    #     train_conf = load_train_config(global_var.loading_address, i)
    #     trainer = Train(**train_conf)
    #     trainer.run()
    #     trainer.logger.visualization()
    #     # 重置global_var.saving_address
    #     global_var.saving_address = temp_saving_path
